﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="OAclient.Common" %>

<script type="text/javascript">
    function open_wftypeadd() {
        $.ajax({
            url: "/WorkFlow/WFTypeAdd",
            type: "POST",
            success: function(data) {
                addtab('12-1', '新建流程');
                $("#workarea-12-1").html(data);
            }
        })
    }
    $(function() {
        tableSelectOrder("#wftypelist .table_style");
    })
</script>

<div id="wftypelist">
    <input type="button" onclick="open_wftypeadd()" value="添加类型" style="margin-top: 5px;" />
    <div style="margin-top: 10px;">
        <table border="0" width="100%" class="table_style" cellpadding="0" cellspacing="0">
            <thead>
                <tr>
                    <th>
                        编码
                    </th>
                    <th>
                        名称
                    </th>
                    <th>
                        状态
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
            </thead>
            <tbody>
                <%
                    System.Data.DataTable dt_wftype = ViewData["dt_wftype"] as System.Data.DataTable;
                    if (dt_wftype == null || dt_wftype.Rows.Count == 0)
                    {%>
                <tr>
                    <td colspan="0" style="text-align: center;">
                        当前无数据！
                    </td>
                </tr>
                <% }
                else
                {
                    for (int i = 0; i < dt_wftype.Rows.Count; i++)
                    {
                %>
                <tr>
                    <td>
                        <%=dt_wftype.Rows[i]["编码"]%>
                    </td>
                    <td>
                        <%=dt_wftype.Rows[i]["名称"]%>
                    </td>
                    <td>
                        <%=dt_wftype.Rows[i]["状态"]%>
                    </td>
                    <td>
                        <%=Ajax.ActionLink("查看", "WFTypeShow", new { wftype_id = dt_wftype.Rows[i]["编码"] },
                                                                        new AjaxOptions { UpdateTargetId = "workarea-12-3-check", OnSuccess = "addtab('12-3-check','" + dt_wftype.Rows[i]["名称"] + "查看')" })%>
                    </td>
                </tr>
                <%
                    }
                }%>
            </tbody>
        </table>
    </div>
    <div id="pageLink">
        <%var pageInfo = ViewData["pageInfo"] as PagingInfo;%>
        <%if (pageInfo != null)
          { %>
        <%=Ajax.PageLinks(pageInfo, index => Url.Action("WFTypeList", new { pageIndex = index }), new AjaxOptions { UpdateTargetId = "wftypelist" })%>
        <%} %>
    </div>
    <br />
</div>
